/*
@Time : 2022/6/18 11:58
@Author : gaozhichang
@File : for.go
@des: GoLand
*/
package main

import (
	"fmt"
	"os"
	"os/signal"
)

func main() {
	//让程序挂起
	c := make(chan os.Signal, 1)
	signal.Notify(c, os.Kill, os.Interrupt)
	//time.Sleep(2 * time.Second) //应该是可有可无
	for {
		select {
		case <-c:
			fmt.Println("我挂了")
			return
		}
	}
}
